package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Objects;

public class CollectionDemo2 {
    public static void main(String[] args) {
        Collection  c = new ArrayList();
        c.add(new Point(1, 2));
        c.add(new Point(3, 4));
        c.add(new Point(5, 6));
        c.add(new Point(7, 8));
        c.add(new Point(1, 2));
        System.out.println(c);

        Point p = new Point(1, 2);

        //包含：判断条件是与给定对象equals()方法
        System.out.println(c.contains(p)); //true

        //删除：判断条件是与给定对象equals()方法
        System.out.println(c.remove(p)); //[(3,4), (5,6), (7,8), (1,2)]
    }
}
